package com.bmps.springcloud.insuredmicroservice.model.accept.resquest;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author lyw
 * @date 2019/07/24
 */
public class InformModel implements Serializable {

    @NotBlank(message = "result字段不能为空!")
    private String result;

    private String resultResignationMsg;

    private String resultAppointMsg;

    @Valid
    @NotNull(message = "disclosures节点不能为空")
    private DisclosuresModel disclosures;

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public String getResultResignationMsg() {
        return resultResignationMsg;
    }

    public void setResultResignationMsg(String resultResignationMsg) {
        this.resultResignationMsg = resultResignationMsg;
    }

    public String getResultAppointMsg() {
        return resultAppointMsg;
    }

    public void setResultAppointMsg(String resultAppointMsg) {
        this.resultAppointMsg = resultAppointMsg;
    }

    public DisclosuresModel getDisclosures() {
        return disclosures;
    }

    public void setDisclosures(DisclosuresModel disclosures) {
        this.disclosures = disclosures;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        InformModel that = (InformModel) o;

        return new EqualsBuilder()
                .append(result, that.result)
                .append(resultResignationMsg, that.resultResignationMsg)
                .append(resultAppointMsg, that.resultAppointMsg)
                .append(disclosures, that.disclosures)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(result)
                .append(resultResignationMsg)
                .append(resultAppointMsg)
                .append(disclosures)
                .toHashCode();
    }

    @Override
    public String toString() {
        return "InformModel{" +
                "result='" + result + '\'' +
                ", resultResignationMsg='" + resultResignationMsg + '\'' +
                ", resultAppointMsg='" + resultAppointMsg + '\'' +
                ", disclosures=" + disclosures +
                '}';
    }
}
